package com.hpin.mlxteacher.child;

import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ImageView;
import android.widget.TextView;

import com.hpin.mlxteacher.R;
import com.hpin.mlxteacher.adapter.ChooseAdapter;
import com.hpin.mlxteacher.base.BaseActivity;
import com.hpin.mlxteacher.bean.People;
import com.hpin.mlxteacher.widget.GridViewForScrollView;

import java.util.ArrayList;
import java.util.List;

/**
 * 宝宝生活记录页面
 * Created by Aaron on 2015/7/28.
 */
public class LifeRecordActivity extends BaseActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.activity_life_record);

        initWidget();
    }

    private void initWidget() {

        ImageView iv_left = (ImageView) findViewById(R.id.iv_left);
        TextView tv_title = (TextView) findViewById(R.id.tv_title);

        tv_title.setText(getResources().getString(R.string.baby_life_record));

        iv_left.setOnClickListener(this);


        GridViewForScrollView gv_baby = (GridViewForScrollView) findViewById(R.id.gv_baby);

        List<People> peoples = new ArrayList<People>();
        People p1 = new People();
        p1.name = "张大大";
        People p2 = new People();
        p2.name = "张小小";
        People p3 = new People();
        p3.name = "张大小";
        People p4 = new People();
        p4.name = "张小大";
        People p5 = new People();
        p5.name = "张轩轩";
        People p6 = new People();
        p6.name = "李大大";
        peoples.add(p1);
        peoples.add(p2);
        peoples.add(p3);
        peoples.add(p4);
        peoples.add(p5);
        peoples.add(p6);
        ChooseAdapter adapter = new ChooseAdapter(this, peoples);
        gv_baby.setAdapter(adapter);

        gv_baby.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                //生活记录


            }
        });

    }

    @Override
    public void widgetClick(View v) {

        switch (v.getId()) {

            case R.id.iv_left :
                finish();
                break;

        }
    }
}
